{% extends "base.html" %}

{% block css_js %}

    <!--DataTables [ OPTIONAL ]-->
    <link href="/static/plugins/datatables/media/css/dataTables.bootstrap.css" rel="stylesheet">
	<link href="/static/plugins/datatables/extensions/Responsive/css/dataTables.responsive.css" rel="stylesheet">



    <!--DataTables [ OPTIONAL ]-->
    <script src="/static/plugins/datatables/media/js/jquery.dataTables.js"></script>
	<script src="/static/plugins/datatables/media/js/dataTables.bootstrap.js"></script>
	<script src="/static/plugins/datatables/extensions/Responsive/js/dataTables.responsive.min.js"></script>


    <!--DataTables Sample [ SAMPLE ]-->
    <script src="/static/js/cmdb/tables-datatables.js"></script>

{% endblock %}
    

{% block content-container %}
    <!--Page Title-->
    <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <div id="page-title">
        <h1 class="page-header text-overflow">主机编辑</h1>
    </div>
    <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <!--End page title-->

    <!--Page content-->
    <!--===================================================-->
    <div id="page-content">

        <div class="panel">
                    <div class="panel-heading">
                        {% if msg.is_admin == 1 %}
                            <a class=" btn btn-danger" href="/hostdelete/" style="float: right; margin-top: 10px; margin-right: 20px;">删除</a>
                            <h3 class="panel-title" style="float: right">删除该主机信息</h3>
                        {% else %}
                            <h3 class="panel-title" style="text-align: right">更改主机信息后保存</h3>
                        {% endif %}
                    </div>

                    <form action="/hostedit/" class="form-horizontal" method="post">
                        <div class="panel-body">
                            <p class="bord-btm pad-ver text-main text-bold">主机基本信息</p>

                            <!--===================================================-->
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-lg-3 control-label">主机实例名</label>
                                    <div class="col-lg-7">
                                        {{ oo.hostinstancename }}
{#					                                <input type="text" class="form-control" name="hostinstancename">#}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-3 control-label">主机名(hostname)</label>
                                    <div class="col-lg-7">
                                        {{ oo.hostname }}
                                        {{ oo.hostname_hide }}
{#					                                <input type="text" class="form-control" name="hostname" disabled="disabled" value="{{ msg.host.hostname }}">#}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-3 control-label">IP地址<br/>(多个值请以英文逗号分隔)</label>
                                    <div class="col-lg-7">
                                        {{ oo.hostipaddr }}
{#                                                  <textarea rows="10" cols="80"></textarea>#}
                                        <span style="color: red">{{ oo.errors.hostipaddr.0 }}</span>
                                    </div>
                                </div>
                            </fieldset>
                            <!--===================================================-->

                            <p class="bord-btm pad-ver text-main text-bold">主机类别信息</p>

                            <!--===================================================-->
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-lg-3 control-label">资产类型</label>
                                    <div class="col-lg-7">
                                        <div class="radio">
                                            {{ oo.hosttype }}
{#                                                    <input id="demo-radio-1" class="magic-radio" type="radio" name="member" value="free">#}
{#                                                    <label for="demo-radio-1">物理机</label>#}
{##}
{#                                                    <input id="demo-radio-2" class="magic-radio" type="radio" name="member" value="personal">#}
{#                                                    <label for="demo-radio-2">ECS</label>#}
{##}
{#                                                    <input id="demo-radio-3" class="magic-radio" type="radio" name="member" value="bussines">#}
{#                                                    <label for="demo-radio-3">阿里云存储服务</label>#}
{##}
{#                                                    <input id="demo-radio-4" class="magic-radio" type="radio" name="member" value="personal">#}
{#                                                    <label for="demo-radio-4">KVM</label>#}
{##}
{#                                                    <input id="demo-radio-5" class="magic-radio" type="radio" name="member" value="bussines">#}
{#                                                    <label for="demo-radio-5">Docker容器</label>#}
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-3 control-label">状态</label>
                                    <div class="col-lg-7">
                                        <div class="radio">
                                            {{ oo.hoststatus }}
{#					                                      <input id="demo-radio-6" class="magic-radio" type="radio" name="member" value="free">#}
{#                                                        <label for="demo-radio-6">上线</label>#}
{##}
{#                                                        <input id="demo-radio-7" class="magic-radio" type="radio" name="member" value="personal">#}
{#                                                        <label for="demo-radio-7">下线</label>#}
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                            <!--===================================================-->

                            <p class="bord-btm pad-ver text-main text-bold">描述信息</p>

                            <!--===================================================-->
                            <fieldset>
                                <div class="form-group">
                                    <label class="col-lg-3 control-label">描述信息</label>
                                    <div class="col-lg-7">
                                        {{ oo.hostdesc }}
{#                                                    <textarea rows="10" cols="80"></textarea>#}
                                        <span style="color: red">{{ oo.errors.hostdesc.0 }}</span>
                                    </div>
                                </div>
                            </fieldset>
                            <!--===================================================-->

                        </div>
                        <div class="panel-footer">
                            <div class="row">
                                <div class="col-sm-7 col-sm-offset-3">
                                    <button class="btn btn-mint" type="submit">保存</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

    </div>
    <!--===================================================-->
    <!--End page content-->
{% endblock %}